Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Designing Applications > Changes to memory management for Document.getItemValue for V8.53
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Community articleChanges to memory management for Document.getItemValue for V8.53
Added by ~Mary Elluski on July 14, 2011 | Version 1
expanded Abstract
collapsed Abstract
This note is to provide insight and best practices concerning changes in backend memory management on Item value retrieval in the V8.53 release
Tags: Java, memory management, LotusScript
There are two ways to access data from an Item. The obvious way is by calling methods on the Item class such as Item.getValues , but methods are also available on the Document class such as Document.getItemValue. These convenience methods are a shortcut if the Item object is not already in hand. When Document class methods are called, backend internals create an intermediate item object to accomplish the data fetch.

In response to Out Of Memory reports from customer installations, we have made internal changes to the way backend does memory management in methods related to the Document.getItemValue method and its derivatives, getItemValueString, getItemValueInteger, getItemValueDouble, as well as the extended property syntax in LotusScript. An example of this would be

val = doc.myItem


where myItem is the name of an Item within doc.

In releases prior to 8.53, when the shortcut methods to access Item data directly from a Document were used, an internal Item object was generated to access the value. Anticipating that the user might later access the Item, the intermediate Items were retained until the Document was destroyed. For the majority of users, this was not a problem, as Documents regularly are recycled or go out of scope, and the number of data accesses were generally not too many.

As the web gains importance, causing data access to simultaneously occur on many webserver worker threads, more conservative memory management techniques are needed. From 8.53 going forward, the internal Items will not be retained, and their memory is recovered as soon as the Item value is retrieved from a Document.

These changes affect both LotusScript and Java applications. Most will not notice the changes, as runtime behavior is identical to previous releases. Others that access many Items and keep many Documents in scope will have more available memory available to them. Note that if you intend to do additional Item calls after data access, it is now more efficient to do a Document.findFirstItem call to get the Item, then retrieve the values by direct calls to methods on the Item class. This is to prevent creating the Item itself multiple times as would be the case with multiple calls to the Document class.

For any applications running on pre-8.53 releases, if memory in this area becomes a problem, a good workaround is to avoid the Document class shortcut methods and instead use the Item class methods such as Item.getValues.
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (2)
collapsed Versions (2)
Version Comparison     
VersionDateChanged by              Summary of changes
2Jul 14, 2011, 7:51:01 PM~Elizabeth Loptumitexoni  Minor Change
This version (1)Jul 14, 2011, 6:19:01 PM~Mary Elluski  
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility